package io.xccit.controller;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;

/**
 * @author Xccit
 * @Date 2023-02-07
 * @Description 首页控制层
 */
@Controller
public class IndexController {
    @RequestMapping("/")
    public String index(){
        return "index";
    }

    /**
     * 同时是/test与/test1请求的处理方法
     * @return
     */
    @RequestMapping({"test","test1"})
    public String test(){
        return "test";
    }
    @RequestMapping(value = "test2",method = {RequestMethod.GET,RequestMethod.POST})
    public String test1(){
        return "test";
    }

    /**
     * 设置必须携带username参数，password参数值必须不为123456
     * @return
     */
    @RequestMapping(value = "test3",method = {RequestMethod.GET,RequestMethod.POST},params = {"username","password!=123456"})
    public String test2(){
        return "test";
    }
}
